#pragma once

#define MAX_BUYITEM_COUNT		(6)

class RectStatic;
class Customer;
class Player;

class GameScene
{
public:
	enum{
		CUSTOMER_STATE_INVALIDE = -1,
		CUSTOMER_STATE_ENTER,
		CUSTOMER_STATE_DROP_ITEM,		
		CUSTOMER_STATE_EXIT,
	};
public:
	GameScene();
	~GameScene();

public:
	void			Init(int nStageIndex);
	void			Release();
	void			Update();

	void			OnMouseMove(int nPosX, int nPosY);
	void			OnMouseLDown(int nPosX, int nPosY);
	void			OnMouseLUp(int nPosX, int nPosY);

	void			EnterCustomer();
	void			DropItem();
	void			ExitCustomer();

	void			SetChange(int val)				{ m_nChange = val; }
	int				GetChange()						{ return m_nChange; }
	
	int				GetBuyItemCount()				{ return m_nBuyItemCount;}
	int				GetBuyItem(int nIndex)			{ return m_nBuyItem[nIndex]; }
	int				GetBuyItemPrice()				{ return m_nBuyItemPrice; }

	void			ShowBuyItem(BOOL bShow)			{ m_bDrawBuyItem = bShow; }

	int				GetSuccessPerson()				{ return m_nSuccessCnt; }
	int				GetFailPerson()					{ return m_nFailCnt; }

private:
	void			UpdateCustomer();
	void			UpdateBuyItem();
	void			InitBuyItem();

private:
	int				m_nStageIndex;
	int				m_nCustomerState;	
	int				m_nDestCustomerPosX;
	int				m_nDestCustomerPosY;
	float			m_fCurCustomerPosX;	
	float			m_fCustomerMoveSpeed;
	int				m_nCustomerJumpSpace;
	int				m_nCustomerJumpOffset;
	float			m_fCustomerScale;
	RECT			m_rcSize;


	RectStatic*		m_rectBackGround;
	RectStatic*		m_rectCounterTable;
	RectStatic*		m_pBuyItem[MAX_BUYITEM_COUNT];
	Customer*		m_pCustomer;
	Player*			m_pPlayer;
	
	int				m_nBuyItemCount;
	int				m_nBuyItemPrice;
	int				m_nBuyItem[MAX_BUYITEM_COUNT];	
	int				m_bBuyItemAlphaTick;
	int				m_bBuyItemDrawTick;
	float			m_fBuyItemMovePos;
	float			m_fBuyItemCurPosY;
	BOOL			m_bDrawBuyItem;

	int				m_nChange;


	int				m_nSuccessCnt;
	int				m_nFailCnt;
};

